#!/bin/csh -f
set usage="Synopsis: multi2 TILING n1,n2,n3 (or cat TILING|multi2 n1,n2,n3)"
set muz=1
set mux=1
set muy=1
set p=1
set q=0
set tiling=
set mult="1x1x2"
set arg=()
foreach x ($argv)
    if (-f $x) then
	set tiling=$x
    else
	set arg=($arg $x)
    endif
end
# MUST set tiling!
if ($tiling == "") then 
    echo "Tiling name required"
    goto help
endif
set argv=($arg)
while ("$*" != "")
    switch ($1)
	case -infl:
	    shift
	    set p=$1
	    shift
	    set q=$1
	breaksw
	case -h:
help:
	    echo $usage
	    echo "Multiplicates unit cell by multi=(mx,my,mz) and/or inflates by P+Q*tau."
	    exit
	breaksw
	default:
	    set mult=$1
	breaksw
    endsw
    shift
end
#cat $tiling | awk -f $DECAHOME/SRC/inflate.awk - $p $q| awk -f $DECAHOME/SRC/multi2.awk - $mux $muy $muz
awk -f $DECAHOME/SRC/multi2.awk $tiling $mult
##

